package com.order.userinterfaces.converter;

import com.order.application.dto.OrderDTO;
import com.order.userinterfaces.vo.OrderVO;

/**
 * @Author 刘志伟
 * @create 2022/9/26 13:56
 */
public class OrderDTOConverter {

    public static OrderDTO vo2OrderDTO(OrderVO orderVO) {
        OrderDTO dto = OrderDTO.builder().cargoesID(orderVO.getCargoesID())
                .orderNO(orderVO.getOrderNO())
                .price(orderVO.getPrice())
                .createDatetime(orderVO.getCreateDatetime()).build();
        return dto;
    }

    public static OrderVO dto2OrderVO(OrderDTO orderDTO) {
        OrderVO vo = OrderVO.builder().cargoesID(orderDTO.getCargoesID())
                .orderNO(orderDTO.getOrderNO())
                .price(orderDTO.getPrice())
                .createDatetime(orderDTO.getCreateDatetime()).build();
        return vo;
    }
}
